package models

//手机号返回码
const (
	RC_PHONE_YIZHI RcPhone = 1000 + iota
	RC_PHONE_NOT_YIZHI
	RC_PHONE_NOT_FOUND
	RC_PHONE_ILLEGAL_PHONE	//手机号码不合法
	RC_PHONE_ILLEGAL_CARD	//身份证不合法
	RC_PHONE_ILLEGAL_NAME	//姓名不合法
	RC_PHONE_REPEAT
)

var (
	phoneDescs = map[RcPhone]string{
		RC_PHONE_YIZHI:"一致",
		RC_PHONE_NOT_YIZHI:"不一致",
		RC_PHONE_NOT_FOUND:"系统无记录",
		RC_PHONE_ILLEGAL_PHONE:"手机号码不合法",
		RC_PHONE_ILLEGAL_CARD:"身份证不合法",
		RC_PHONE_ILLEGAL_NAME:"姓名不合法",
		RC_PHONE_REPEAT:"请稍后再试",
	}
)

//身份证二要素返回码结构体
type RcPhone int

func (this RcPhone) Desc() string {
	return phoneDescs[this]
}

func (this RcPhone) Code() int {
	return int(this)
}